package com.crm.sys.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.crm.base.dao.BaseDao;
import com.crm.sys.dao.ApproveDao;
import com.crm.sys.model.ApproveConfigure;
import com.crm.sys.model.ApproveConfigureItem;
import com.crm.sys.model.ApproveRecord;
@Repository("approveDao")
public class ApproveDaoImpl  extends BaseDao  implements ApproveDao {

	@Override
	public List<ApproveConfigure> getApproveConfigureListByCode(
			ApproveConfigure acg) {
		/*StringBuffer sql = new StringBuffer();
		sql.append(XmlReader.readXml(Constants.ApproveFileName,"ApproveDao_getApproveConfigure"));
		sql.append(XmlReader.readXml(Constants.ApproveFileName,"ApproveDao_getApproveConfigureListByCode"));
		List<ApproveConfigure> list = jdbcTemplate.query(sql.toString(),new Object[]{acg.getCode()},new BeanPropertyRowMapper(ApproveConfigure .class));
		return list; */
		return null;
	}

	@Override
	public void insertApproveRecord(final List<ApproveRecord> arList) {
		/*StringBuffer sql = new StringBuffer();
		sql.append(XmlReader.readXml(Constants.ApproveFileName,"ApproveDao_insertApproveRecord"));
		int[] resultCount =  jdbcTemplate.batchUpdate(sql.toString(), new BatchPreparedStatementSetter()  { 
			   public void setValues(PreparedStatement ps,int i)throws SQLException 
			   { 
				  int count =1;
				  ps.setObject(count++, arList.get(i).getName());
		          ps.setObject(count++,arList.get(i).getAcid());
		          ps.setObject(count++, arList.get(i).getUrl());
		          ps.setObject(count++, arList.get(i).getRemark());
		          ps.setObject(count++, arList.get(i).getParentid());
		          ps.setObject(count++, arList.get(i).getUid());
		          ps.setObject(count++, arList.get(i).getLevel());
		          ps.setObject(count++, arList.get(i).getState());
		          ps.setObject(count++, arList.get(i).getType());
		          ps.setObject(count++, arList.get(i).getContent());
		          ps.setObject(count++, arList.get(i).getNewcontent());
		          ps.setObject(count++, arList.get(i).getUpdateuser()); 
		          ps.setObject(count++, arList.get(i).getNumber()); 
		          ps.setObject(count++, arList.get(i).getContentid()); 
		          ps.setObject(count++, arList.get(i).getCategory()); 
		          ps.setObject(count++, arList.get(i).getCreateuser()); 
			   } 
			   @Override
				public int getBatchSize() {
					return arList.size();
				}
		    
		  }); */
	}

	@Override
	public int updateApproveRecord(ApproveRecord ar) {
	/*	StringBuffer sql= new  StringBuffer();
		sql.append(XmlReader.readXml(Constants.ApproveFileName,"ApproveDao_updateApproveRecord"));
		int result =jdbcTemplate.update(sql.toString() ,new Object[]{
			   ar.getRemark(),ar.getState(),ar.getUpdateuser(),ar.getUid(),ar.getId()
			});
		return result;*/ 
		return 0;
	}

	@Override
	public List<ApproveRecord> getApproveRecordList(ApproveRecord ar) {
		
		/*StringBuffer sql = new StringBuffer();
		List<Object>  objList = new ArrayList();
		sql.append(XmlReader.readXml(Constants.ApproveFileName,"ApproveDao_getApproveRecordList"));
		if(ar.getType()!=null){
			objList.add(ar.getType());
			sql.append(XmlReader.readXml(Constants.ApproveFileName,"ApproveDao_getApproveRecordListParam"));
		}
		if(ar.getUid()!=null){
			objList.add(ar.getUid());
			sql.append(XmlReader.readXml(Constants.ApproveFileName,"ApproveDao_getApproveRecordListParam1"));
		}
		if(ar.getState()!=null){
			objList.add(ar.getState());
			sql.append(XmlReader.readXml(Constants.ApproveFileName,"ApproveDao_getApproveRecordListParam3"));
		}
		sql.append(XmlReader.readXml(Constants.ApproveFileName,"ApproveDao_getApproveRecordListParam2"));
		List<ApproveRecord> list = jdbcTemplate.query(sql.toString(),objList.toArray(),new BeanPropertyRowMapper(ApproveRecord .class));
		return list; */
		return null;
	}

	@Override
	public List<ApproveConfigureItem> getApproveConfigureItemByAcId(int acid) {
		/*StringBuffer sql = new StringBuffer();
		sql.append(XmlReader.readXml(Constants.ApproveFileName,"ApproveDao_getApproveConfigureItem"));
		sql.append(XmlReader.readXml(Constants.ApproveFileName,"ApproveDao_getApproveConfigureItemByAcId"));
		List<ApproveConfigureItem> list = jdbcTemplate.query(sql.toString(),new Object[]{acid},new BeanPropertyRowMapper(ApproveConfigureItem .class));
		return list; */
		return null;
	}

	@Override
	public List<ApproveConfigureItem> getApproveConfigureItemByCode(String code) {
		/*StringBuffer sql = new StringBuffer();
		sql.append(XmlReader.readXml(Constants.ApproveFileName,"ApproveDao_getApproveConfigureItem"));
		sql.append(XmlReader.readXml(Constants.ApproveFileName,"ApproveDao_getApproveConfigureItemByCode"));
		List<ApproveConfigureItem> list = jdbcTemplate.query(sql.toString(),new Object[]{code},new BeanPropertyRowMapper(ApproveConfigureItem .class));
		return list; */
		return null;
	}

	@Override
	public ApproveRecord getApproveRecordByID(Integer id) {
		 
	/*	StringBuffer sql = new StringBuffer();
		sql.append(XmlReader.readXml(Constants.ApproveFileName,"ApproveDao_getApproveRecordByID"));
		List<ApproveRecord> list = jdbcTemplate.query(sql.toString(),new Object[]{id},new BeanPropertyRowMapper(ApproveRecord .class));
		return list!=null?list.get(0):null;*/
		return null;
	}

	@Override
	public ApproveRecord getApproveRecordRemark(String contentid, int type) {
		/*StringBuffer sql = new StringBuffer();
		sql.append(XmlReader.readXml(Constants.ApproveFileName,"ApproveDao_getApproveRecordRemark"));
		List<ApproveRecord> list = jdbcTemplate.query(sql.toString(),new Object[]{contentid,type},new BeanPropertyRowMapper(ApproveRecord .class));
		return list!=null?list.get(0):null;*/
		return null;
	}

}
